package com.guigu.work.feign;

import com.guigu.order.entity.Order;
import com.guigu.tms.result.R;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.Map;

/**
 * @ClassName:OrderFeign
 * @Description://TODO
 * @Author:taoLong
 * @Date:2021/11/27:16:42 星期六
 * @email:2391611102@qq.com or 2391611102qq@gmail.com
 */
@FeignClient(value = "service-order")
public interface OrderFeign {

    /**
     * 获取订单详情信息
     *
     * @param orderId
     * @return
     */
    @ApiOperation("根据id查询订单,订单重量,订单位置信息")
    @ApiImplicitParam(name = "orderId", value = "订单Id")
    @GetMapping("/order/order/getOrderInfoByOrderId/{orderId}")
    public R<Map> getOrderInfoByOrderId(@PathVariable("orderId") String orderId);


    /**
     * 根据订单Id获取订单信息
     *
     * @param id
     * @return
     */
    @ApiOperation("根据订单Id获取订单信息")
    @GetMapping("/order/order/getOrderById/{id}")
    public Order getOrderById(@PathVariable("id") String id);

    @ApiOperation("根据id改状态")
    @ApiImplicitParam(name = "orderId", value = "订单Id")
    @GetMapping("/order/order/updateStatusById/{id}/{status}")
    public R updateStatusById(@PathVariable("id") String id,@PathVariable("status") Integer status);
}
